package com.zhilei.feign;

import com.zhilei.grace.result.GraceJSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 根据公司的id查询当前公司下HR的数量
 *
 * @author 志磊
 * @since 2024-09-27
 */
@FeignClient("user-service-7001")
public interface UserInfoMicroServiceFeign {

    /**
     * 远程调用
     *
     * @param companyId
     * @return
     */
    @PostMapping("/userinfo/getCountsByCompanyId")
    GraceJSONResult getCountsByCompanyId(@RequestParam("companyId") String companyId);

    /**
     * 绑定hr跟企业之间的关系
     *
     * @param hrUserId
     * @param realname
     * @param companyId
     * @return
     */
    @PostMapping("/userinfo/bindingHRToCompany")
    GraceJSONResult bindingHRToCompany(@RequestParam("hrUserId") String hrUserId,
                                       @RequestParam("realname") String realname,
                                       @RequestParam("companyId") String companyId);

    /**
     * 根据用户id查询最新用户信息
     *
     * @param userId
     * @return
     */
    @PostMapping("/userinfo/get")
    GraceJSONResult get(@RequestParam("userId") String userId);

    /**
     * 更新角色为hr权限
     *
     * @param hrUserId
     * @return
     */
    @PostMapping("/userinfo/updateHRRole")
    GraceJSONResult updateHRRole(@RequestParam("hrUserId") String hrUserId);
}
